using System;
using System.Collections.Generic;
using System.Text;
using QuanLyKhachSan.DTO;
using System.Data;

namespace QuanLyKhachSan.BUS
{
    public class LoaiKhachHangBUS
    {
        // Them Loai Khach Hang
        public static bool Insert(LoaiKhachHangDTO loaiKHdto)
        {
            return LoaiKhachHangDAO.Insert(loaiKHdto);
        }

        // Xoa Loai Khach Hang
        public static bool Delete(LoaiKhachHangDTO loaiKHdto)
        {
            return LoaiKhachHangDAO.Delete(loaiKHdto.MaLoaiKH );
        }

        // Cap nhat thong tin loai khach hang
        public static bool Update(LoaiKhachHangDTO loaiKHdto)
        {
            return LoaiKhachHangDAO.Update(loaiKHdto);
        }

        // Lay danh sach khach hang
        public static DataTable LayDSLoaiKH()
        {
            DataTable dt = new DataTable();
            dt = LoaiKhachHangDAO.LayDSLoaiKH();
            return dt;
        }
        public static DataTable LayDSLoaiKHTheoTen(string tenLoai)
        {
            DataTable dt = new DataTable();
            dt = LoaiKhachHangDAO.LayDSLoaiKHTheoTen(tenLoai);
            return dt;
        }
        public static LoaiKhachHangDTO  LayLoaiKhachHangTheoMaLoai(int maLoaiKH)
        {
            LoaiKhachHangDTO loaiKhachHangdto = new LoaiKhachHangDTO();
            loaiKhachHangdto = LoaiKhachHangDAO.LayLoaiKhachHangTheoMaLoai(maLoaiKH);
            return loaiKhachHangdto ;
        }
        public static LoaiKhachHangDTO LayLoaiKhachHangTheoTenLoaiKH(string tenLoaiKH)
        {
            LoaiKhachHangDTO loaiKhachHangdto = new LoaiKhachHangDTO();
            loaiKhachHangdto = LoaiKhachHangDAO.LayLoaiKhachHangTheoTenLoaiKH(tenLoaiKH);
            return loaiKhachHangdto;
        }
        public static float LayHeSoTheoTenLoaiKH(string tenLoaiKH)
        {
            DataTable dt = new DataTable();
            dt = LoaiKhachHangDAO.LayHeSoTheoTenLoaiKH(tenLoaiKH);
            DataRow dr = dt.Rows[0];
            return float.Parse(dr[0].ToString());
        }
    }
}
